home *** CD-ROM | disk | FTP | other *** search
- class CLSRule {
- String pred;
- String succ;
- String lContext;
- String rContext;
-
- public CLSRule(String p, String d, String l, String r) {
- this.pred = p;
- this.succ = d;
- this.lContext = l;
- this.rContext = r;
- }
-
- public boolean matches(StringBuffer sb, int pos) {
- if (pos + this.pred.length() > sb.length()) {
- return false;
- } else {
- char[] cb = new char[this.pred.length()];
- sb.getChars(pos, pos + this.pred.length(), cb, 0);
- return this.pred.equals(new String(cb));
- }
- }
- }
-